import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        isCollapse: false,
        collapseClass: 'navbar',
        menuData: []
    },
    getters: {},
    mutations: {
        changeIsCollapse(state) {
            state.isCollapse = !state.isCollapse
        },
        changeCollapseClass(state) {
            if (state.isCollapse) {
                state.collapseClass = 'navbar navbar-collapse'
            } else {
                state.collapseClass = 'navbar'
            }
        },
        changeMenuData(state,payload) {
            state.menuData = payload
        },
    },
    actions: {},
    modules: {}
})
